<%@page import="tools.MyTool"%>
<%@page import="java.util.Iterator"%>
<%@page import="accessor.Products"%>
<%@page import="accessor.HomeProductAccessor"%>
<%@page import="accessor.CategoryAccessor"%>
<%@page import="accessor.Category"%>
<%@page import="java.util.List"%>
</div>
<!-- end #content -->
<div id="sidebar">
    <%
        CategoryAccessor accessor = new CategoryAccessor();
        List<Category> categories = accessor.getRootCategories();
        HomeProductAccessor homeProductAccessor1 = new HomeProductAccessor();
        List<Products> features = homeProductAccessor1.getFeatureProduct(5);
    %>
    <div id="vmenu">
        <h2>CATEGORIES</h2>
        <ul>
            <%for (Category category : categories) {%>
            <li><a href="listing.jsp?cateID=<%=category.getCategoryID()%>"><%=category.getCategoryName()%></a></li>
            <%}%>
        </ul>
    </div>

    <div class="box_left">
        <h2>FEATURE PRODUCTS</h2>
        <%
            for (Iterator it = features.iterator(); it.hasNext();) {
                Products featurePro = (Products)it.next();
        %>
        <div class="list_news">
            <div class="list_news_left">
                <a href="details.jsp?productID=<%=featurePro.getProductID()%>"><img src="../assets/img/p/<%=featurePro.getDefaultImage()%>" style="border: none" width="69" height="69"></a>
            </div>
            <div class="list_news_right">                            
                <h3><a href="details.jsp?productID=<%=featurePro.getProductID()%>" title="aaa"><%=featurePro.getProductName()%></a></h3>
            </div>
            <div style="clear: both;"><%=new MyTool().getShortDescription(featurePro.getDescription(),10)%></div>
        </div>  
        <%}%>
    </div>

    <div class="left_banner">
        <img src="../assets/css/frontend/images/banner_left_1.jpg" width="197" height="94" alt="ac">
    </div>                              

    <div class="left_banner">
        <img src="../assets/css/frontend/images/banner_left_2.jpg" width="197" height="94" alt="ac">
    </div>                                                  

</div>
<!-- end #sidebar -->
<div style="clear: both;">&nbsp;</div>

</div>
<!-- end #page --> 
</div>